<?php
/*
+-----------------------------------------------------------------------------+
| $Id: *.php 2009-08-18 08:41:22Z Bleakwind $
| Copyright (c) 2003-2010 Bleakwind (www.weaverdream.com)
| http://www.weaverdream.com/
+-----------------------------------------------------------------------------+
*/

if (!defined( 'ENTRY_INDEX')){
    echo "<h1>Forbidden</h1><p>You don't have permission to access on this server.</p>";
    exit;
}

if($sys->get['ope'] == "save"){
    // check the post
    if ($sys->post['if_email'] == ""
        ){
        $sys->cp_prompt("failed",$LANGUAGE['s']['cp_config']['form_empty']);
    }elseif(!preg_match("/^[12]{1}$/",$sys->post['if_email'])){
        $sys->cp_prompt("failed",$LANGUAGE['s']['cp_config']['if_email_error']);
    }else{
        
        $sql = "UPDATE ".DB_TABLE_MEMBER." SET
                   if_email    = '".addslashes((int)$sys->post['if_email'])."'
                WHERE id= '".$MEMBER['id']."'";
        if (!$db->Execute($sql)) {
            echo $db->ErrorMsg();
        }else{
            $sys->cp_prompt("succeed","修改成功!", $CONFIGURE['common']['control_index']."?act=cp");
        }
    }
}
$public_var['page_place'][] = $LANGUAGE['s']['cp_config']['page_place_upper'];
$public_var['page_place'][] = $LANGUAGE['s']['cp_config']['page_place'];
?>
